Follow-up Ifd700826 (60d119c), address a fixme in a re-enabled test.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 23 Sep 2012 08:15:20 +0000 (10:15 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 23 Sep 2012 08:15:20 +0000 (10:15 +0200)
Make the "Date menu next month is 11 months ago" also work when the
current month is december.

Change-Id: Ie7b998bf962abbb3e2f789a3d8a9af8c52e7feaa

tests/phpunit/includes/XmlTest.php

index 562c687..7f25f58 100644 (file)
@@ -37,7 +37,7 @@ class XmlTest extends MediaWikiTestCase {
        public function tearDown() {
                global $wgLang, $wgContLang;
                $wgLang = self::$oldLang;
-               
+
                $wgContLang->setNamespaces( self::$oldNamespaces );
        }
 
@@ -162,10 +162,9 @@ class XmlTest extends MediaWikiTestCase {
                        "Date menu year is the current one when not specified"
                );
 
-               // @todo FIXME: next month can be in the next year
-               // test failing because it is now december
+               $wantedYear = $nextMonth == 1 ? $curYear : $prevYear;
                $this->assertEquals(
-                       Xml::dateMenu( $prevYear, $nextMonth ),
+                       Xml::dateMenu( $wantedYear, $nextMonth ),
                        Xml::dateMenu( '', $nextMonth ),
                        "Date menu next month is 11 months ago"
                );